// 封装所有与权限有关的 接口
import instance from "@/utils/request";

// 根据id更新权限点详情
export function updatePerApi(data) {
  return instance({
    url: `/sys/permission/${data.id}`,
    method: "PUT",
    data
  });
}

// 根据id获取权限点详情
export function getPerInfoApi(id) {
  return instance({
    url: `/sys/permission/${id}`
  });
}

// 根据id 删除权限点
export function delPerApi(id) {
  return instance({
    url: `/sys/permission/${id}`,
    method: "DELETE"
  });
}

// 添加权限点
export function addPerApi(data) {
  return instance({
    url: "/sys/permission",
    method: "POST",
    data
  });
}

// 获取所有权限点
export function getAllPerApi() {
  return instance({
    url: "/sys/permission"
  });
}
